import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from "./store";
import './permission'
import ElementUI from 'element-ui' // 引用element-ui
import 'element-ui/lib/theme-chalk/index.css'  // css需要单独引入
import './styles/element-ui.scss'
import './styles/index.scss'
import "./assets/iconfont/iconfont.css"
import "./assets/iconfont/iconfont.js"   // 引入iconfont的symbol类型
import echarts from 'echarts'
import axios from 'axios'
// import './mock/mock.js'

// 全局注册svgIcon组件
import './icons'

// markdown 编辑器
import VMdEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
// markdown主题
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
// 快捷复制代码
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index';
import '@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css';
// 显示代码行号
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index';
// 引入流程图
import createMermaidPlugin from '@kangc/v-md-editor/lib/plugins/mermaid/cdn';
import '@kangc/v-md-editor/lib/plugins/mermaid/mermaid.css';
// 引入katex公式
import createKatexPlugin from '@kangc/v-md-editor/lib/plugins/katex/cdn';

// markdown 预览组件
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';

import Prism from 'prismjs';

// 打印 全局挂载
import Print from 'vue-print-nb'
Vue.use(Print)

// 引入dataV
// 将自动注册所有组件为全局组件
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)

VMdEditor.use(vuepressTheme, {
  Prism,
  extend(md) {
    // md为 markdown-it 实例，可以在此处进行修改配置,并使用 plugin 进行语法扩展
    // md.set(option).use(plugin);
  },
  // 扩展代码高亮类型
  codeHighlightExtensionMap: {
    vue: 'xml',
  },
});
VMdPreview.use(vuepressTheme, {
  Prism,
  // 扩展代码高亮类型
  codeHighlightExtensionMap: {
    vue: 'xml',
  },
});
// markdown 编辑器 使用插件
VMdEditor.use(createCopyCodePlugin())
VMdEditor.use(createLineNumbertPlugin());
VMdEditor.use(createMermaidPlugin());
VMdEditor.use(createKatexPlugin());

// markdown 预览 使用插件
VMdPreview.use(createCopyCodePlugin())
VMdPreview.use(createLineNumbertPlugin());
VMdPreview.use(createMermaidPlugin());
VMdPreview.use(createKatexPlugin());

Vue.use(VMdPreview);
Vue.use(VMdEditor)

Vue.prototype.$axios =axios;

Vue.prototype.$echarts = echarts;

Vue.config.productionTip = false

Vue.use(ElementUI) // 使用引入的element-ui

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
